package com.larissa.android.quiz;

import androidx.lifecycle.ViewModel;

import com.larissa.android.quiz.question.Question;
import com.larissa.android.quiz.question.QuestionRepository;

import java.util.List;

public class MainViewModel extends ViewModel{
    //问题索引，-1表示答题已经结束
    private int questionIndex = 0;
    //答对的答案个数
    private int numberOfRightAnswers = 0;
    private int helpTimes = 0;
    private int wrongTimes = 0;
    //有没有按帮助
    private boolean showed = false;
    private String time = " ";

    private List<Question> geoQuestions;
    private List<Question> mathQuestions;

    public MainViewModel() {
        geoQuestions = QuestionRepository.getInstance().getGeoQuestions();
        mathQuestions = QuestionRepository.getInstance().getMathQuestions();
    }

    public int getQuestionIndex() {
        return questionIndex;
    }

    public void setQuestionIndex(int questionIndex) {
        this.questionIndex = questionIndex;
    }

    public void questionIndexPP()
    {
        questionIndex++;
    }


    public int getNumberOfRightAnswers() {
        return numberOfRightAnswers;
    }

    public void setNumberOfRightAnswers(int numberOfRightAnswers) {
        this.numberOfRightAnswers = numberOfRightAnswers;
    }

    public void rightAnswersPP()
    {
        numberOfRightAnswers++;
    }

    public int getHelpTimes() {
        return helpTimes;
    }

    public void setHelpTimes(int helpTimes) {
        this.helpTimes = helpTimes;
    }

    public int getWrongTimes() {
        return wrongTimes;
    }

    public void setWrongTimes(int wrongTimes) {
        this.wrongTimes = wrongTimes;
    }

    public boolean isShowed() {
        return showed;
    }

    public void setShowed(boolean showed) {
        this.showed = showed;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public List<Question> getGeoQuestions() {
        return geoQuestions;
    }

    public List<Question> getMathQuestions() {
        return mathQuestions;
    }
}
